package com.share.design.composite;

/**
 * author:caifan
 * date:2020/2/5
 */
public class CompositeClient {
    public static void main(String[] args) {
        Bags bags = new Bags("大包");
        Goods apple = new Goods("苹果", 10, 2.3f);
        Goods banana = new Goods("香蕉", 10, 1.3f);
        Goods orange = new Goods("橘子", 10, 2.11f);
        bags.add(apple);
        bags.add(banana);
        bags.add(orange);

        bags.calculate();
        bags.show();
    }
}
